Skip to content

Add cppcheck marker to collected items for -m filtering#12

Merged
alexdej merged 1 commit intomainfrom
add-cppcheck-marker
Mar 26, 2026
Merged

Add cppcheck marker to collected items for -m filtering#12
alexdej merged 1 commit intomainfrom
add-cppcheck-marker

Conversation

@alexdej
Copy link
Copy Markdown
Owner

@alexdej alexdej commented Mar 26, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 26, 2026 21:55
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR makes pytest-cppcheck’s collected cppcheck test item selectable via pytest’s -m marker filtering by registering and applying a cppcheck marker.

Changes:

  • Register a cppcheck marker in pytest_configure to avoid unknown-marker warnings.
  • Add the cppcheck marker to the collected CppcheckItem so -m cppcheck/-m 'not cppcheck' filtering works.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +64 to +66
item = CppcheckItem.from_parent(self, name="CPPCHECK")
item.add_marker(pytest.mark.cppcheck)
yield item
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New behavior adds a cppcheck marker so users can filter with -m cppcheck, but there’s no test asserting that marker-based selection works (e.g., pytest --cppcheck -m cppcheck runs the item, and pytest --cppcheck -m 'not cppcheck' deselects it). Please add a pytester test to cover the marker filtering to prevent regressions.

Copilot uses AI. Check for mistakes.
@alexdej alexdej merged commit 68c4aec into main Mar 26, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants